package com.zihao.solon_study.Auth;

import com.zihao.solon_study.Auth.Adapter.SystemAuthAdapter;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.auth.AuthAdapter;

/**
 * 接口鉴权
 */

@Configuration
public class AppAuth {
    @Bean
    public AuthAdapter createAuthAapter() {
        return new AuthAdapter()
                .addRule(b -> b.include("**").verifyPath())
                .addRule(e -> e.exclude("/hi").verifyPath())
                .processor(new SystemAuthAdapter()) // 添加自定义加强验证
                ;
    }
}
